feat(update): install-source-aware self-update subcommand#7
Merged
Conversation
quire edit - --content - rejects the both-stdin-args combination before it reads stdin, so the test's write_all raced the child's exit and panicked with BrokenPipe when the child won (intermittent CI failure on main). Tolerate the expected BrokenPipe; the real assertions (exit 1 + stderr message) are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
quire update upgrades the installed binary to the latest published version. Because quire ships via two channels (npm prebuilt-binary wrapper and cargo install --git), it detects the install source from the running executable path (node_modules -> npm, .cargo -> cargo, else unknown) and drives the matching package manager; an unknown source prints manual instructions and exits 0 without touching the network. The logic lives in a package-agnostic self_update engine (config-struct driven, no quire coupling) so it can later extract into a shared Rust CLI kit; commands/update.rs is the thin quire wrapper. No cross-scheme version diff (npm wrapper and Cargo versions are decoupled) -- idempotency is delegated to npm/cargo. A --registry override is applied as the --@agent-ix:registry= scope form (a plain --registry is ignored for a scoped package when npmrc pins a scope registry). Adds FR-016 + tests.md traceability. Deliberate exception to the quire-rs thin boundary (StR-004): binary lifecycle, not artifact behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a `quire update` subcommand that upgrades the installed binary to the latest published version, plus a fix for a pre-existing flaky test on `main`.
`quire update [--check] [--registry ]`
Because quire ships through two channels — the npm prebuilt-binary wrapper (`@agent-ix/quire-cli`) and `cargo install --git` — `update` detects how the running binary was installed (from `current_exe`: a `node_modules` path component → npm, `.cargo` → cargo, else unknown) and drives the matching package manager:
No cross-scheme version diff — the npm-wrapper and Cargo versions are independently numbered, so idempotency is delegated to npm/cargo. A `--registry` override is applied as the scope-specific `--@agent-ix:registry=` form (a plain `--registry` is silently ignored for a scoped package when npmrc pins a scope registry); with no override the ambient npm config resolves the package.
Two-layer structure (kit-ready)
Deliberate exception to the quire-rs thin boundary (StR-004): this manages binary lifecycle, not artifact behavior, so it carries no parser/validator logic and wraps no `quire-rs` API.
Flaky-test fix (separate commit)
`edit_rejects_doc_and_content_both_stdin` raced the child's early exit and intermittently panicked with `BrokenPipe` (the failure on `main`'s last CI run). Tolerate the expected BrokenPipe; the real assertions are unchanged.
Spec
Tests
🤖 Generated with Claude Code